package com.lv.qm;

import android.util.Log;

import com.lv.base.base.UtilsApp;
import com.lv.libsocket.ForegroundCallbacks;
import com.lv.libsocket.WsManager;
import com.lv.monkey.utils.languageutils.MultiLanguageUtil;

/**
 * 作者：created by albert on 2018/9/21 16:21
 * 邮箱：lvzhongdi@icloud.com
 *
 * @param
 **/
public class App extends UtilsApp {


    public static final String BROADCAST_PERMISSION_DISC = "com.cn.customview.permissions.MY_BROADCAST";
    public static final String BROADCAST_ACTION_DISC = "com.cn.customview.permissions.my_broadcast";


    @Override
    public void onCreate() {
        super.onCreate();
        MultiLanguageUtil.init(this);
        initAppStatusListener();
    }

    private void initAppStatusListener() {

        ForegroundCallbacks.init(this).addListener(new ForegroundCallbacks.Listener() {
            @Override
            public void onBecameForeground() {
                Log.i("WsManager", "应用回到前台调用重连方法");
                WsManager.getInstance(getApplicationContext()).reconnect();
            }

            @Override
            public void onBecameBackground() {

            }
        });

    }
}
